package com.example.administrator.myapplication;

import android.app.Application;
import android.content.Context;
import android.widget.Toast;

/**
 * Created by Administrator on 2017/8/3 0003.
 */

public class MyBaseApplication extends Application{
    private static Context mContext;

    @Override
    public void onCreate() {
        super.onCreate();
        mContext = getApplicationContext();
    }
    public static Context getContextObject(){
        return mContext;
    }
    private static Toast toast = null;

    public static Toast showToastMake(CharSequence message){
        if(toast!=null){
            toast.setText(message);
        }else {
            toast = Toast.makeText(MyBaseApplication.getContextObject(),message,Toast.LENGTH_SHORT);
        }
        return toast;
    }
}
